package com.minimoment.model.domain;

import org.hibernate.search.annotations.*;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by etund on 2014/10/27.
 */
@SuppressWarnings("all")
@Indexed
public class Movie implements Serializable {
    public Movie() {
    }

    /**
     id					Long					(主键)
     movieName			String					电影名
     reaseTime			Date					上映时间
     timeLength			String 					时长
     introduction		String(6000)			介绍
     language			String					语言
     type				String					类型
     */
    private Long id;
    private String director;
    private String actor;
    private String movieName;
    private Date realseTime;
    private String timeLength;
    private String introduction;
    private String language;
    private String type;
    private String androidImage;
//    评分：0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
    private Float score;
    /**
     * 0是已经过期
     * 1 正在热播
     * 2 上头条
     * 3 即将上映
     * 默认是1
      */
    private Long flag = 1L;
    /**
     *      area				String					地区
     previewPath			String					预告片(视频)
     tibits				String					花絮(视频)
     imagePath			String					精彩镜头(图片)
     grade				String					评分(先由后台工作人员评分)
     screenings			Set(一对多)				一部电影有多个场次
     movieNews			Set(多对多)				一部电影有多则新闻(tb_movie_movieNews)
     coments				Set(一对多)				一个电影有很多评论(tb_movie_coments)
     users 				Set(多对多)				收藏该影片的用户(tb_favriousMovie)
     theaters			Set(多对多)				这部电影在多家影院都有播放
     .......
     */
    private String area;
    private String previewPath;
    private String tibits;
    private String imagePath;
//    用来放在头条
    private String headPath;


    private Set<Screenings> screeningses = new HashSet<Screenings>();
    private Set<MovieNews> movieNewses = new HashSet<MovieNews>();
    private Set<User> users= new HashSet<User>();
    private Set<UMcomemt> umComemts  = new HashSet<UMcomemt>();
    private Set<Theater> theaters = new HashSet<Theater>();
    private Set<Telecine> telecines = new HashSet<Telecine>();


    public Set<Telecine> getTelecines() {
        return telecines;
    }

    public void setTelecines(Set<Telecine> telecines) {
        this.telecines = telecines;
    }

    public String getAndroidImage() {
        return androidImage;
    }

    public void setAndroidImage(String androidImage) {
        this.androidImage = androidImage;
    }

    public String getDirector() {
        return director;
    }

    @Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
    public void setDirector(String director) {
        this.director = director;
    }

    @Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
    public String getActor() {
        return actor;
    }

    public void setActor(String actor) {
        this.actor = actor;
    }

    public Set<Screenings> getScreeningses() {
        return screeningses;
    }

    public void setScreeningses(Set<Screenings> screeningses) {
        this.screeningses = screeningses;
    }

    public Set<MovieNews> getMovieNewses() {
        return movieNewses;
    }

    public void setMovieNewses(Set<MovieNews> movieNewses) {
        this.movieNewses = movieNewses;
    }

    public Set<User> getUsers() {
        return users;
    }

    public void setUsers(Set<User> users) {
        this.users = users;
    }



    public Set<UMcomemt> getUmComemts() {
        return umComemts;
    }

    public void setUmComemts(Set<UMcomemt> umComemts) {
        this.umComemts = umComemts;
    }

    public Set<Theater> getTheaters() {
        return theaters;
    }

    public void setTheaters(Set<Theater> theaters) {
        this.theaters = theaters;
    }

    @Id
   @DocumentId
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Field(index= Index.YES, analyze= Analyze.YES, store=Store.NO)
    public String getMovieName() {
        return movieName;
    }

    public void setMovieName(String movieName) {
        this.movieName = movieName;
    }

    @Field(index=Index.YES, analyze=Analyze.NO, store=Store.NO)
    public Date getRealseTime() {
        return realseTime;
    }

    public void setRealseTime(Date realseTime) {
        this.realseTime = realseTime;
    }

    public String getTimeLength() {
        return timeLength;
    }

    public void setTimeLength(String timeLength) {
        this.timeLength = timeLength;
    }

    @Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getPreviewPath() {
        return previewPath;
    }

    public void setPreviewPath(String previewPath) {
        this.previewPath = previewPath;
    }

    public String getTibits() {
        return tibits;
    }

    public void setTibits(String tibits) {
        this.tibits = tibits;
    }

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    public Long getFlag() {
        return flag;
    }

    public void setFlag(Long flag) {
        this.flag = flag;
    }

    public String getHeadPath() {
        return headPath;
    }

    public void setHeadPath(String headPath) {
        this.headPath = headPath;
    }

    public Float getScore() {
        return score;
    }

    public void setScore(Float score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Movie{" +
                "id=" + id +
                ", director='" + director + '\'' +
                ", actor='" + actor + '\'' +
                ", movieName='" + movieName + '\'' +
                ", realseTime=" + realseTime +
                ", timeLength='" + timeLength + '\'' +
                ", introduction='" + introduction + '\'' +
                ", language='" + language + '\'' +
                ", type='" + type + '\'' +
                ", androidImage='" + androidImage + '\'' +
                ", score=" + score +
                ", flag=" + flag +
                ", area='" + area + '\'' +
                ", previewPath='" + previewPath + '\'' +
                ", tibits='" + tibits + '\'' +
                ", imagePath='" + imagePath + '\'' +
                ", headPath='" + headPath + '\'' +
                ", screeningses=" + screeningses +
                ", movieNewses=" + movieNewses +
                ", users=" + users +
                ", umComemts=" + umComemts +
                ", theaters=" + theaters +
                '}';
    }
}
